@model IEnumerable<MaciejGrabek.WP7.Services.Model.ViewModel.GameResultsViewModel>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>ASP.NET Web API</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/modernizr-2.0.6-development-only.js")" type="text/javascript"></script>
    <meta name="viewport" content="width=device-width" />
</head>
<body>
    <header>
        <div class="content-wrapper">       
            <div class="float-left">
                <p class="site-title"><a href="/">Windows Phone Game Services</a></p>
            </div>
        </div>
    </header>
    <div id="body">
        <h2>Games</h2>
        @if (Model != null)
        {
            foreach (var item in Model)
            {
                <h3>@item.Game.Name</h3>
                <table>
                    <tr>
                        <th>
                            #
                        </th>
                        <th>
                            Player name
                        </th>
                        <th>
                            Score
                        </th>
                        <th>
                            Date
                        </th>
                    </tr>
                    @foreach (var score in item.Results)
                    {
                        <tr>
                            <td>
                                @score.OrderNumber
                            </td>
                            <td>
                                @score.PlayerName
                            </td>
                            <td>
                                @score.Score
                            </td>
                            <td>
                                @score.DateTimeString
                            </td>
                        </tr>
                    }
                </table>
            }
        }
        else
        {
            <h3>Currently there are no game results. Come back later.</h3>
        }
    </div>
</body>
</html>
